import React, { useState } from "react";
import { NavBar, Tabs } from "antd-mobile";
import { useNavigate } from "react-router-dom";
import Buy from "./Buy";
import Sell from "./Sell";
import Send from "./Send";
import Collection from "./Collection";
import { useSelector } from "react-redux";
export default function Order() {
  let Navigate = useNavigate();
  const activeKey = useSelector((data) => {
    return data.actKey;
  });
  return (
    <div>
      <NavBar
        onBack={() => {
          Navigate("/My");
        }}
      >
        订单中心
      </NavBar>
      <Tabs defaultActiveKey={activeKey}>
        <Tabs.Tab title="我买过的" key="Buy">
          <Buy></Buy>
        </Tabs.Tab>
        <Tabs.Tab title="我卖出的" key="Sell">
          <Sell></Sell>
        </Tabs.Tab>
        <Tabs.Tab title="我发布的" key="Send">
          <Send></Send>
        </Tabs.Tab>
        <Tabs.Tab title="我收藏的" key="Collection">
          <Collection></Collection>
        </Tabs.Tab>
      </Tabs>
    </div>
  );
}
